Optimal. Leaf size=133 \[ -\frac {(A c+3 B c+3 A d-7 B d) \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{2 \sqrt {2} a^{3/2} f}-\frac {(A-B) (c-d) \cos (e+f x)}{2 f (a+a \sin (e+f x))^{3/2}}-\frac {2 B d \cos (e+f x)}{a f \sqrt {a+a \sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3047, 3098,
2830, 2728, 212} \begin {gather*} -\frac {(A c+3 A d+3 B c-7 B d) \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{2 \sqrt {2} a^{3/2} f}-\frac {(A-B) (c-d) \cos (e+f x)}{2 f (a \sin (e+f x)+a)^{3/2}}-\frac {2 B d \cos (e+f x)}{a f \sqrt {a \sin (e+f x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 2728
Rule 2830
Rule 3047
Rule 3098
Rubi steps
\begin {align*} \int \frac {(A+B \sin (e+f x)) (c+d \sin (e+f x))}{(a+a \sin (e+f x))^{3/2}} \, dx &=\int \frac {A c+(B c+A d) \sin (e+f x)+B d \sin ^2(e+f x)}{(a+a \sin (e+f x))^{3/2}} \, dx\\ &=-\frac {(A-B) (c-d) \cos (e+f x)}{2 f (a+a \sin (e+f x))^{3/2}}-\frac {\int \frac {-\frac {1}{2} a (3 B (c-d)+A (c+3 d))-2 a B d \sin (e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx}{2 a^2}\\ &=-\frac {(A-B) (c-d) \cos (e+f x)}{2 f (a+a \sin (e+f x))^{3/2}}-\frac {2 B d \cos (e+f x)}{a f \sqrt {a+a \sin (e+f x)}}+\frac {(A c+3 B c+3 A d-7 B d) \int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx}{4 a}\\ &=-\frac {(A-B) (c-d) \cos (e+f x)}{2 f (a+a \sin (e+f x))^{3/2}}-\frac {2 B d \cos (e+f x)}{a f \sqrt {a+a \sin (e+f x)}}-\frac {(A c+3 B c+3 A d-7 B d) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{2 a f}\\ &=-\frac {(A c+3 B c+3 A d-7 B d) \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{2 \sqrt {2} a^{3/2} f}-\frac {(A-B) (c-d) \cos (e+f x)}{2 f (a+a \sin (e+f x))^{3/2}}-\frac {2 B d \cos (e+f x)}{a f \sqrt {a+a \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.32, size = 246, normalized size = 1.85 \begin {gather*} \frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (2 (A-B) (c-d) \sin \left (\frac {1}{2} (e+f x)\right )-(A-B) (c-d) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+(1+i) (-1)^{3/4} (A c+3 B c+3 A d-7 B d) \tanh ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (-1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2-4 B d \cos \left (\frac {1}{2} (e+f x)\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2+4 B d \sin \left (\frac {1}{2} (e+f x)\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2\right )}{2 f (a (1+\sin (e+f x)))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(388\) vs.
\(2(116)=232\).
time = 6.89, size = 389, normalized size = 2.92
method | result | size |
default | \(-\frac {\left (\sin \left (f x +e \right ) \left (A \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a c +3 A \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a d +3 B \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a c -7 B \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a d +8 B \sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\, d \right )+A \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a c +3 A \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a d +3 B \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a c -7 B \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a d +2 A \sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\, c -2 A \sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\, d -2 B \sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\, c +10 B \sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\, d \right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}}{4 a^{\frac {5}{2}} \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(389\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 431 vs.
\(2 (122) = 244\).
time = 0.42, size = 431, normalized size = 3.24 \begin {gather*} -\frac {\sqrt {2} {\left ({\left ({\left (A + 3 \, B\right )} c + {\left (3 \, A - 7 \, B\right )} d\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (A + 3 \, B\right )} c - 2 \, {\left (3 \, A - 7 \, B\right )} d - {\left ({\left (A + 3 \, B\right )} c + {\left (3 \, A - 7 \, B\right )} d\right )} \cos \left (f x + e\right ) - {\left (2 \, {\left (A + 3 \, B\right )} c + 2 \, {\left (3 \, A - 7 \, B\right )} d + {\left ({\left (A + 3 \, B\right )} c + {\left (3 \, A - 7 \, B\right )} d\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )\right )} \sqrt {a} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )} + 3 \, a \cos \left (f x + e\right ) - {\left (a \cos \left (f x + e\right ) - 2 \, a\right )} \sin \left (f x + e\right ) + 2 \, a}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right ) - 4 \, {\left (4 \, B d \cos \left (f x + e\right )^{2} + {\left (A - B\right )} c - {\left (A - B\right )} d + {\left ({\left (A - B\right )} c - {\left (A - 5 \, B\right )} d\right )} \cos \left (f x + e\right ) + {\left (4 \, B d \cos \left (f x + e\right ) - {\left (A - B\right )} c + {\left (A - B\right )} d\right )} \sin \left (f x + e\right )\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{8 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f \cos \left (f x + e\right ) - 2 \, a^{2} f - {\left (a^{2} f \cos \left (f x + e\right ) + 2 \, a^{2} f\right )} \sin \left (f x + e\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (A + B \sin {\left (e + f x \right )}\right ) \left (c + d \sin {\left (e + f x \right )}\right )}{\left (a \left (\sin {\left (e + f x \right )} + 1\right )\right )^{\frac {3}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\left (A+B\,\sin \left (e+f\,x\right )\right )\,\left (c+d\,\sin \left (e+f\,x\right )\right )}{{\left (a+a\,\sin \left (e+f\,x\right )\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________